home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 2002 November / SGI IRIX 6.5 Applications 2002 November.iso / dist / sgi_apache.idb / var / sgi_apache / server / include / os.h.z / os.h
Encoding:
C/C++ Source or Header  |  2002-06-27  |  4.8 KB  |  152 lines

  1. /* ====================================================================
  2.  * The Apache Software License, Version 1.1
  3.  *
  4.  * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
  5.  * reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms, with or without
  8.  * modification, are permitted provided that the following conditions
  9.  * are met:
  10.  *
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  *
  14.  * 2. Redistributions in binary form must reproduce the above copyright
  15.  *    notice, this list of conditions and the following disclaimer in
  16.  *    the documentation and/or other materials provided with the
  17.  *    distribution.
  18.  *
  19.  * 3. The end-user documentation included with the redistribution,
  20.  *    if any, must include the following acknowledgment:
  21.  *       "This product includes software developed by the
  22.  *        Apache Software Foundation (http://www.apache.org/)."
  23.  *    Alternately, this acknowledgment may appear in the software itself,
  24.  *    if and wherever such third-party acknowledgments normally appear.
  25.  *
  26.  * 4. The names "Apache" and "Apache Software Foundation" must
  27.  *    not be used to endorse or promote products derived from this
  28.  *    software without prior written permission. For written
  29.  *    permission, please contact apache@apache.org.
  30.  *
  31.  * 5. Products derived from this software may not be called "Apache",
  32.  *    nor may "Apache" appear in their name, without prior written
  33.  *    permission of the Apache Software Foundation.
  34.  *
  35.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  36.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  37.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  39.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  40.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  41.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  42.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  43.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  44.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  45.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  46.  * SUCH DAMAGE.
  47.  * ====================================================================
  48.  *
  49.  * This software consists of voluntary contributions made by many
  50.  * individuals on behalf of the Apache Software Foundation.  For more
  51.  * information on the Apache Software Foundation, please see
  52.  * <http://www.apache.org/>.
  53.  *
  54.  * Portions of this software are based upon public domain software
  55.  * originally written at the National Center for Supercomputing Applications,
  56.  * University of Illinois, Urbana-Champaign.
  57.  */
  58.  
  59. #ifndef APACHE_OS_H
  60. #define APACHE_OS_H
  61.  
  62. #include "ap_config.h"
  63.  
  64. #ifndef PLATFORM
  65. #define PLATFORM "Unix"
  66. #endif
  67.  
  68. /*
  69.  * This file in included in all Apache source code. It contains definitions
  70.  * of facilities available on _this_ operating system (HAVE_* macros),
  71.  * and prototypes of OS specific functions defined in os.c or os-inline.c
  72.  */
  73.  
  74. #if !defined(INLINE) && defined(USE_GNU_INLINE)
  75. /* Compiler supports inline, so include the inlineable functions as
  76.  * part of the header
  77.  */
  78. #define INLINE extern ap_inline
  79.  
  80. INLINE int ap_os_is_path_absolute(const char *file);
  81.  
  82. #include "os-inline.c"
  83.  
  84. #else
  85.  
  86. /* Compiler does not support inline, so prototype the inlineable functions
  87.  * as normal
  88.  */
  89. extern int ap_os_is_path_absolute(const char *file);
  90. #endif
  91.  
  92. /* Other ap_os_ routines not used by this platform */
  93.  
  94. #define ap_os_is_filename_valid(f)          (1)
  95. #define ap_os_kill(pid, sig)                kill(pid, sig)
  96.  
  97. /*
  98.  *  Abstraction layer for loading
  99.  *  Apache modules under run-time via 
  100.  *  dynamic shared object (DSO) mechanism
  101.  */
  102.  
  103. #ifdef HAVE_DL_H
  104. #include <dl.h>
  105. #endif
  106.  
  107. /*
  108.  * Do not use native AIX DSO support on releases of AIX prior
  109.  * to 4.3. 
  110.  */
  111. #ifdef AIX
  112. #if AIX < 43
  113. #undef HAVE_DLFCN_H
  114. #endif
  115. #endif
  116.  
  117. #ifdef HAVE_DLFCN_H
  118. #include <dlfcn.h>
  119. #else
  120. void *dlopen(const char *, int);
  121. int dlclose(void *);
  122. void *dlsym(void *, const char *);
  123. const char *dlerror(void);
  124. #endif
  125.  
  126. /* probably on an older system that doesn't support RTLD_NOW or RTLD_LAZY.
  127.  * The below define is a lie since we are really doing RTLD_LAZY since the
  128.  * system doesn't support RTLD_NOW.
  129.  */
  130. #ifndef RTLD_NOW
  131. #define RTLD_NOW 1
  132. #endif
  133.  
  134. #ifndef RTLD_GLOBAL
  135. #define RTLD_GLOBAL 0
  136. #endif
  137.  
  138. #if (defined(__FreeBSD__) ||\
  139.      defined(__OpenBSD__) ||\
  140.      defined(__NetBSD__)     ) && !defined(__ELF__)
  141. #define DLSYM_NEEDS_UNDERSCORE
  142. #endif
  143.  
  144. #define     ap_os_dso_handle_t  void *
  145. void        ap_os_dso_init(void);
  146. void *      ap_os_dso_load(const char *);
  147. void        ap_os_dso_unload(void *);
  148. void *      ap_os_dso_sym(void *, const char *);
  149. const char *ap_os_dso_error(void);
  150.  
  151. #endif    /* !APACHE_OS_H */
  152.